<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>修改密码</title>
	<meta name="decorator" content="nblank"/>
</head>
<body>
<div class="content container">
	<h2 class="page-title">个人中心
		<small> 修改密码</small>
	</h2>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/sys/user/info">基本信息</a></li>
		<li class="active"><a href="${ctx}/sys/user/modifyPwd">修改密码</a></li>
	</ul>
	<section class="widget widget-tabs widget-table-overflow ">
		<div class="body tab-content">
		<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/modifyPwd" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<sys:message content="${message}"/>
			<div class="form-group">
				<label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 旧密码:</label>
				<div class="col-sm-4">
					<input id="oldPassword" name="oldPassword" type="password" value="" maxlength="50" minlength="3" class="form-control input-transparent"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 新密码:</label>
				<div class="col-sm-4">
					<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="3" class="form-control input-transparent"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 确认新密码:</label>
				<div class="col-sm-4">
					<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="3" class="form-control input-transparent" equalTo="#newPassword"/>
				</div>
			</div>
			<div class="form-actions">
				<div class="text-align-center">
					<input id="btnCancel" class="btn btn-default" type="button" style="margin-left: -50px;min-width:100px;" value="返 回" onclick="history.go(-1)"/>
					<input id="btnSubmit" class="btn btn-primary" style="margin-left:50px;min-width:100px;" type="submit" value="保 存"/>&nbsp;
				</div>
			</div>
		</form:form>
		</div>
	</section>
</div>
<script type="text/javascript">
	$(document).ready(function() {
		$("#oldPassword").focus();
		$("#inputForm").validate({
			rules: {
			},
			messages: {
				confirmNewPassword: {equalTo: "输入与上面相同的密码"}
			},
			submitHandler: function(form){
				loading('正在提交，请稍等...');
				form.submit();
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				$("#messageBox").text("输入有误，请先更正。");
				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
					error.appendTo(element.parent().parent());
				} else {
					error.insertAfter(element);
				}
			}
		});
	});
</script>
</body>
</html>